<!-- HTML header for doxygen 1.8.20-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
	<meta http-equiv="X-UA-Compatible" content="IE=9"/>
	<meta name="generator" content="Doxygen 1.9.4"/>
	<meta name="viewport" content="width=device-width, initial-scale=1"/>
	<title>Raspberry Pi Pico SDK: include/hardware/adc.h File Reference</title>
	<!-- <link href="tabs.css" rel="stylesheet" type="text/css"/> -->
	<script type="text/javascript" src="jquery.js"></script>
	<script type="text/javascript" src="dynsections.js"></script>
	<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
	<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
    <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap" rel="stylesheet">
	<link href="doxygen.css" rel="stylesheet" type="text/css" />
	<link href="normalise.css" rel="stylesheet" type="text/css"/>
<link href="main.css" rel="stylesheet" type="text/css"/>
<link href="styles.css" rel="stylesheet" type="text/css"/>
</head>
<body>
	<div class="navigation-mobile">
		<div class="logo--mobile">
			<a href="/"><img src="logo-mobile.svg" alt="Raspberry Pi"></a>
		</div>
		<div class="navigation-toggle">
			<span class="line-1"></span>
			<span class="line-2">
				<p>Menu Toggle</p>
			</span>
			<span class="line-3"></span>
		</div>
	</div>
	<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
		<div class="logo">
			<a href="index.html"> <img src="logo.svg" alt="Raspberry Pi"></a>
			<span style="display: inline-block; margin-top: 10px;">
				v2.1.0
			</span>
		</div>
		<div class="navigation-footer">
			<img src="logo-mobile.svg" alt="Raspberry Pi">
			<a href="https://www.raspberrypi.com/" target="_blank">By Raspberry Pi Ltd</a>
		</div>
<!-- 		<div class="search">
			<form>
				<input type="search" name="search" id="search" placeholder="Search">
				<input type="submit" value="Search">
			</form>
		</div> -->
<!-- Generated by Doxygen 1.9.4 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('rp2__common_2hardware__adc_2include_2hardware_2adc_8h.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle"><div class="title">adc.h File Reference</div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &quot;<a class="el" href="pico_8h_source.html">pico.h</a>&quot;</code><br />
<code>#include &quot;hardware/structs/adc.h&quot;</code><br />
<code>#include &quot;<a class="el" href="gpio_8h_source.html">hardware/gpio.h</a>&quot;</code><br />
</div><div class="textblock"><div class="dynheader">
Include dependency graph for adc.h:</div>
<div class="dyncontent">
<div class="center"><img src="rp2__common_2hardware__adc_2include_2hardware_2adc_8h__incl.png" border="0" usemap="#ainclude_2hardware_2adc_8h" alt=""/></div>
<map name="ainclude_2hardware_2adc_8h" id="ainclude_2hardware_2adc_8h">
<area shape="rect" title=" " alt="" coords="666,5,839,32"/>
<area shape="rect" href="pico_8h.html" title=" " alt="" coords="617,468,678,495"/>
<area shape="rect" title=" " alt="" coords="667,80,838,107"/>
<area shape="rect" href="gpio_8h.html" title=" " alt="" coords="879,80,1005,107"/>
<area shape="rect" href="common_2pico__base__headers_2include_2pico_2types_8h_source.html" title=" " alt="" coords="158,692,259,719"/>
<area shape="rect" title=" " alt="" coords="389,543,503,569"/>
<area shape="rect" href="common_2pico__base__headers_2include_2pico_2config_8h_source.html" title=" " alt="" coords="527,543,631,569"/>
<area shape="rect" href="platform_8h.html" title=" " alt="" coords="656,543,777,569"/>
<area shape="rect" href="error_8h_source.html" title=" " alt="" coords="801,543,896,569"/>
<area shape="rect" href="assert_8h_source.html" title=" " alt="" coords="5,767,111,793"/>
<area shape="rect" title=" " alt="" coords="74,841,157,868"/>
<area shape="rect" title=" " alt="" coords="211,767,281,793"/>
<area shape="rect" title=" " alt="" coords="306,767,381,793"/>
<area shape="rect" title=" " alt="" coords="173,617,337,644"/>
<area shape="rect" href="compiler_8h_source.html" title=" " alt="" coords="362,617,543,644"/>
<area shape="rect" href="sections_8h_source.html" title=" " alt="" coords="567,617,746,644"/>
<area shape="rect" href="panic_8h_source.html" title=" " alt="" coords="770,617,930,644"/>
<area shape="rect" title=" " alt="" coords="1130,617,1341,644"/>
<area shape="rect" title=" " alt="" coords="955,617,1105,644"/>
<area shape="rect" title=" " alt="" coords="357,692,548,719"/>
<area shape="rect" title=" " alt="" coords="685,162,852,189"/>
<area shape="rect" title=" " alt="" coords="876,155,1043,196"/>
<area shape="rect" title=" " alt="" coords="1067,155,1214,196"/>
<area shape="rect" href="irq_8h.html" title=" " alt="" coords="1239,162,1355,189"/>
<area shape="rect" href="address__mapped_8h.html" title=" " alt="" coords="1083,393,1294,420"/>
<area shape="rect" title=" " alt="" coords="1212,244,1381,271"/>
<area shape="rect" href="cpu__regs_8h_source.html" title=" " alt="" coords="1405,244,1588,271"/>
<area shape="rect" title=" " alt="" coords="1331,393,1491,420"/>
<area shape="rect" href="m33_8h_source.html" title=" " alt="" coords="1211,319,1387,345"/>
<area shape="rect" title=" " alt="" coords="1463,319,1637,345"/>
<area shape="rect" title=" " alt="" coords="1661,319,1831,345"/>
</map>
</div>
</div>
<p><a href="rp2__common_2hardware__adc_2include_2hardware_2adc_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="define-members" name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a2184940532514879b5b91cb921821e14"><td class="memItemLeft" align="right" valign="top"><a id="a2184940532514879b5b91cb921821e14" name="a2184940532514879b5b91cb921821e14"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>PARAM_ASSERTIONS_ENABLED_HARDWARE_ADC</b>&#160;&#160;&#160;0</td></tr>
<tr class="separator:a2184940532514879b5b91cb921821e14"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9622105dbe8b3d37a5118dab13c551e9"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rp2__common_2hardware__adc_2include_2hardware_2adc_8h.html#a9622105dbe8b3d37a5118dab13c551e9">ADC_TEMPERATURE_CHANNEL_NUM</a>&#160;&#160;&#160;(NUM_ADC_CHANNELS - 1)</td></tr>
<tr class="separator:a9622105dbe8b3d37a5118dab13c551e9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa659cbc3d47e124b9f7b4956cb7055da"><td class="memItemLeft" align="right" valign="top"><a id="aa659cbc3d47e124b9f7b4956cb7055da" name="aa659cbc3d47e124b9f7b4956cb7055da"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>PICO_ADC_CLKDIV_ROUND_NEAREST</b>&#160;&#160;&#160;PICO_CLKDIV_ROUND_NEAREST</td></tr>
<tr class="separator:aa659cbc3d47e124b9f7b4956cb7055da"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga2b815e6730e8723a6d1d06d9ef8f31c0"><td class="memItemLeft" align="right" valign="top">
void&#160;</td><td class="memItemRight" valign="bottom"><b>adc_init</b> (void)</td></tr>
<tr class="memdesc:ga2b815e6730e8723a6d1d06d9ef8f31c0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialise the ADC HW. <br /></td></tr>
<tr class="separator:ga2b815e6730e8723a6d1d06d9ef8f31c0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab15d6e804715935b4e9b5027a2940910"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__adc.html#gab15d6e804715935b4e9b5027a2940910">adc_gpio_init</a> (uint gpio)</td></tr>
<tr class="memdesc:gab15d6e804715935b4e9b5027a2940910"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialise the gpio for use as an ADC pin.  <a href="group__hardware__adc.html#gab15d6e804715935b4e9b5027a2940910">More...</a><br /></td></tr>
<tr class="separator:gab15d6e804715935b4e9b5027a2940910"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5d3b8875947df2f4ba022cb6aa40594b"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__adc.html#ga5d3b8875947df2f4ba022cb6aa40594b">adc_select_input</a> (uint input)</td></tr>
<tr class="memdesc:ga5d3b8875947df2f4ba022cb6aa40594b"><td class="mdescLeft">&#160;</td><td class="mdescRight">ADC input select.  <a href="group__hardware__adc.html#ga5d3b8875947df2f4ba022cb6aa40594b">More...</a><br /></td></tr>
<tr class="separator:ga5d3b8875947df2f4ba022cb6aa40594b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga84b5f9054de9c00d51095c9bdefb2dca"><td class="memItemLeft" align="right" valign="top">static uint&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__adc.html#ga84b5f9054de9c00d51095c9bdefb2dca">adc_get_selected_input</a> (void)</td></tr>
<tr class="memdesc:ga84b5f9054de9c00d51095c9bdefb2dca"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the currently selected ADC input channel.  <a href="group__hardware__adc.html#ga84b5f9054de9c00d51095c9bdefb2dca">More...</a><br /></td></tr>
<tr class="separator:ga84b5f9054de9c00d51095c9bdefb2dca"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga16d25be75e16f0671d3e3185b0b59771"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__adc.html#ga16d25be75e16f0671d3e3185b0b59771">adc_set_round_robin</a> (uint input_mask)</td></tr>
<tr class="memdesc:ga16d25be75e16f0671d3e3185b0b59771"><td class="mdescLeft">&#160;</td><td class="mdescRight">Round Robin sampling selector.  <a href="group__hardware__adc.html#ga16d25be75e16f0671d3e3185b0b59771">More...</a><br /></td></tr>
<tr class="separator:ga16d25be75e16f0671d3e3185b0b59771"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga33f302059e05899d1709d6268d75972b"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__adc.html#ga33f302059e05899d1709d6268d75972b">adc_set_temp_sensor_enabled</a> (bool enable)</td></tr>
<tr class="memdesc:ga33f302059e05899d1709d6268d75972b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enable the onboard temperature sensor.  <a href="group__hardware__adc.html#ga33f302059e05899d1709d6268d75972b">More...</a><br /></td></tr>
<tr class="separator:ga33f302059e05899d1709d6268d75972b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf32d82a43103e6672048001f58d5f6fb"><td class="memItemLeft" align="right" valign="top">static uint16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__adc.html#gaf32d82a43103e6672048001f58d5f6fb">adc_read</a> (void)</td></tr>
<tr class="memdesc:gaf32d82a43103e6672048001f58d5f6fb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Perform a single conversion.  <a href="group__hardware__adc.html#gaf32d82a43103e6672048001f58d5f6fb">More...</a><br /></td></tr>
<tr class="separator:gaf32d82a43103e6672048001f58d5f6fb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5d50a24eb26da7fbc6ee9bc76723b09c"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__adc.html#ga5d50a24eb26da7fbc6ee9bc76723b09c">adc_run</a> (bool run)</td></tr>
<tr class="memdesc:ga5d50a24eb26da7fbc6ee9bc76723b09c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enable or disable free-running sampling mode.  <a href="group__hardware__adc.html#ga5d50a24eb26da7fbc6ee9bc76723b09c">More...</a><br /></td></tr>
<tr class="separator:ga5d50a24eb26da7fbc6ee9bc76723b09c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga333f7ca46a11241d96d0a4c24f0d4bb0"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__adc.html#ga333f7ca46a11241d96d0a4c24f0d4bb0">adc_set_clkdiv</a> (float clkdiv)</td></tr>
<tr class="memdesc:ga333f7ca46a11241d96d0a4c24f0d4bb0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the ADC Clock divisor.  <a href="group__hardware__adc.html#ga333f7ca46a11241d96d0a4c24f0d4bb0">More...</a><br /></td></tr>
<tr class="separator:ga333f7ca46a11241d96d0a4c24f0d4bb0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga2a6fa32da04e65a027e14deaf32b8f10"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__adc.html#ga2a6fa32da04e65a027e14deaf32b8f10">adc_fifo_setup</a> (bool en, bool dreq_en, uint16_t dreq_thresh, bool err_in_fifo, bool byte_shift)</td></tr>
<tr class="memdesc:ga2a6fa32da04e65a027e14deaf32b8f10"><td class="mdescLeft">&#160;</td><td class="mdescRight">Setup the ADC FIFO.  <a href="group__hardware__adc.html#ga2a6fa32da04e65a027e14deaf32b8f10">More...</a><br /></td></tr>
<tr class="separator:ga2a6fa32da04e65a027e14deaf32b8f10"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gafdfd586e6c26ffe4759afaa3c3f95465"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__adc.html#gafdfd586e6c26ffe4759afaa3c3f95465">adc_fifo_is_empty</a> (void)</td></tr>
<tr class="memdesc:gafdfd586e6c26ffe4759afaa3c3f95465"><td class="mdescLeft">&#160;</td><td class="mdescRight">Check FIFO empty state.  <a href="group__hardware__adc.html#gafdfd586e6c26ffe4759afaa3c3f95465">More...</a><br /></td></tr>
<tr class="separator:gafdfd586e6c26ffe4759afaa3c3f95465"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gafa9793deea59c5cbfea147e0e9d895c3"><td class="memItemLeft" align="right" valign="top">static uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__adc.html#gafa9793deea59c5cbfea147e0e9d895c3">adc_fifo_get_level</a> (void)</td></tr>
<tr class="memdesc:gafa9793deea59c5cbfea147e0e9d895c3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get number of entries in the ADC FIFO.  <a href="group__hardware__adc.html#gafa9793deea59c5cbfea147e0e9d895c3">More...</a><br /></td></tr>
<tr class="separator:gafa9793deea59c5cbfea147e0e9d895c3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga689d64744e7fe5284562569b24e9d624"><td class="memItemLeft" align="right" valign="top">static uint16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__adc.html#ga689d64744e7fe5284562569b24e9d624">adc_fifo_get</a> (void)</td></tr>
<tr class="memdesc:ga689d64744e7fe5284562569b24e9d624"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get ADC result from FIFO.  <a href="group__hardware__adc.html#ga689d64744e7fe5284562569b24e9d624">More...</a><br /></td></tr>
<tr class="separator:ga689d64744e7fe5284562569b24e9d624"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga61553375ecc9275fa14c6ff7792a1506"><td class="memItemLeft" align="right" valign="top">static uint16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__adc.html#ga61553375ecc9275fa14c6ff7792a1506">adc_fifo_get_blocking</a> (void)</td></tr>
<tr class="memdesc:ga61553375ecc9275fa14c6ff7792a1506"><td class="mdescLeft">&#160;</td><td class="mdescRight">Wait for the ADC FIFO to have data.  <a href="group__hardware__adc.html#ga61553375ecc9275fa14c6ff7792a1506">More...</a><br /></td></tr>
<tr class="separator:ga61553375ecc9275fa14c6ff7792a1506"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad637d97583f2c24e4159dc22bf17eaf2"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__adc.html#gad637d97583f2c24e4159dc22bf17eaf2">adc_fifo_drain</a> (void)</td></tr>
<tr class="memdesc:gad637d97583f2c24e4159dc22bf17eaf2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Drain the ADC FIFO.  <a href="group__hardware__adc.html#gad637d97583f2c24e4159dc22bf17eaf2">More...</a><br /></td></tr>
<tr class="separator:gad637d97583f2c24e4159dc22bf17eaf2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf8e363e63f40e00c169f7355c9668681"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__adc.html#gaf8e363e63f40e00c169f7355c9668681">adc_irq_set_enabled</a> (bool enabled)</td></tr>
<tr class="memdesc:gaf8e363e63f40e00c169f7355c9668681"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enable/Disable ADC interrupts.  <a href="group__hardware__adc.html#gaf8e363e63f40e00c169f7355c9668681">More...</a><br /></td></tr>
<tr class="separator:gaf8e363e63f40e00c169f7355c9668681"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a id="a9622105dbe8b3d37a5118dab13c551e9" name="a9622105dbe8b3d37a5118dab13c551e9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9622105dbe8b3d37a5118dab13c551e9">&#9670;&nbsp;</a></span>ADC_TEMPERATURE_CHANNEL_NUM</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define ADC_TEMPERATURE_CHANNEL_NUM&#160;&#160;&#160;(NUM_ADC_CHANNELS - 1)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p >The ADC channel number of the on-board temperature sensor </p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->

	<script src="main.js"></script>
</body>
</html>